package com.briup.service.impl;

import com.briup.bean.ShopAddress;
import com.briup.dao.ShopAddressMapper;
import com.briup.service.IShopAddressService;
import com.briup.util.MyBatisSqlSessionFactory;

import java.util.List;

public class IShopAddressServiceImpl implements IShopAddressService {
    private ShopAddressMapper shopAddressMapper;
    {
        shopAddressMapper= MyBatisSqlSessionFactory.openSession().getMapper(ShopAddressMapper.class);
    }

    //根据用户ID查找收货地址
    @Override
    public List<ShopAddress> findAddressByCustomerId(Integer id) {
        return shopAddressMapper.findAddressByCustomerId(id);
    }

    //新增收货地址
    @Override
    public void saveAddress(ShopAddress sd) {
        shopAddressMapper.saveAddress(sd);
    }
}